home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / php / PEAR / XML / FastCreate.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  19.6 KB  |  707 lines

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Master file that defined the base structure for extended classes (drivers).
  7.  *
  8.  * This is the file included by the end-developper. The driver class needed is 
  9.  * automatically included.
  10.  *
  11.  * PHP versions 4 and 5
  12.  *
  13.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  14.  * that is available through the world-wide-web at the following URI:
  15.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  16.  * the PHP License and are unable to obtain it through the web, please
  17.  * send a note to license@php.net so we can mail you a copy immediately.
  18.  *
  19.  * @category   XML
  20.  * @package    XML_FastCreate
  21.  * @author     Guillaume Lecanu <Guillaume@dev.fr>
  22.  * @copyright  1997-2005 The PHP Group
  23.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  24.  * @version    CVS: $Id: FastCreate.php,v 1.7 2005/12/10 17:26:54 guillaume Exp $
  25.  * @link       http://pear.php.net/package/XML_FastCreate
  26.  * @see        XML_Tree
  27.  */
  28.  
  29. require_once 'PEAR.php';
  30.  
  31. // {{{ constants
  32.  
  33. /**
  34.  * Errors of XML_FastCreate
  35.  */
  36. define('XML_FASTCREATE_ERROR_NO_FACTORY', 1);
  37. define('XML_FASTCREATE_ERROR_NO_DRIVER', 2);
  38. define('XML_FASTCREATE_ERROR_DTD', 3);
  39.  
  40. /**
  41.  * Default filename for 'file' option
  42.  */
  43. define('XML_FASTCREATE_FILE', '/tmp/XML_FastCreate.xml');
  44.  
  45. /**
  46.  * Default program for 'exec' option
  47.  */
  48. define('XML_FASTCREATE_EXEC',
  49.     '/usr/bin/xmllint --valid --noout /tmp/XML_FastCreate.xml 2>&1');
  50.  
  51. /**
  52.  * DocType : XHTML 1.1
  53.  */
  54. define('XML_FASTCREATE_DOCTYPE_XHTML_1_1', 
  55.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" '
  56.     .'"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
  57.  
  58. /**
  59.  * DocType : XHTML 1.0 Strict
  60.  */
  61. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_STRICT',
  62.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '
  63.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
  64.  
  65. /**
  66.  * DocType : XHTML 1.0 Transitional
  67.  */
  68. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_TRANSITIONAL',
  69.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '
  70.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  71.  
  72. /**
  73.  * DocType : XHTML 1.0 Frameset
  74.  */
  75. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_FRAMESET',
  76.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" '
  77.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">');
  78.  
  79. /**
  80.  * DocType : XHTML 4.01 Strict
  81.  */
  82. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_STRICT',
  83.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
  84.     .'"http://www.w3.org/TR/html4/strict.dtd">');
  85.  
  86. /**
  87.  * DocType : XHTML 4.01 Transitional
  88.  */
  89. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_Transitional',
  90.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" '
  91.     .'"http://www.w3.org/TR/html4/loose.dtd">');
  92.  
  93. /**
  94.  * DocType : XHTML 4.01 Frameset
  95.  */
  96. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_Frameset',
  97.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" '
  98.     .'"http://www.w3.org/TR/html4/frameset.dtd">');
  99.  
  100. // }}}
  101.  
  102.  
  103.  
  104. /**
  105.  * Make a special class for overloading, depending of the PHP version.
  106.  * The class XML_FastCreate extend this special class 'XML_FastCreate_Overload'
  107.  */
  108. if (isSet($GLOBAALS['XML_FASTCREATE_NO_OVERLOAD']) 
  109.     && $GLOBAALS['XML_FASTCREATE_NO_OVERLOAD']) {
  110.     if (is_array($GLOBAALS['XML_FASTCREATE_NO_OVERLOAD'])) {
  111.         $class = 'class XML_FastCreate_Overload extends PEAR {';
  112.         foreach ($GLOBAALS['XML_FASTCREATE_NO_OVERLOAD'] as $tag) {
  113.             $class .= <<<TEXT
  114.             function $tag() { 
  115.                 \$args = func_get_args();
  116.                 array_unshift(\$args, '$tag');
  117.                 return call_user_func_array(array(&\$this, 'xml'), \$args);
  118.             }
  119. TEXT;
  120.         }
  121.         $class .= ' }';
  122.         eval($class);
  123.     } else {
  124.         class XML_FastCreate_Overload extends PEAR {}
  125.     }
  126. } else {
  127.     if (phpversion() < 5) {
  128.         $class = <<<TEXT
  129.         class XML_FastCreate_Overload extends PEAR {
  130.             function __call(\$method, \$args, &\$return)
  131.             {
  132.                 if (\$method != __CLASS__) {
  133.                     \$return = \$this->_call(\$method, \$args);
  134.                 }
  135.                 return true;
  136.             }
  137.         }
  138. TEXT;
  139.         eval($class);
  140.         if (function_exists('overload')) {
  141.             overload('XML_FastCreate_Overload');
  142.         }
  143.     } else {
  144.         $class = <<<TEXT
  145.         class XML_FastCreate_Overload extends PEAR {
  146.             function __call(\$method, \$args) 
  147.             {
  148.                 if (\$method != __CLASS__) {
  149.                     return \$this->_call(\$method, \$args);
  150.                 }
  151.             }
  152.         }
  153. TEXT;
  154.         eval($class);
  155.     }
  156. }
  157.  
  158.  
  159. // {{{ XML_FastCreate
  160.  
  161. /**
  162.  * Master class to used the XML_FastCreate application.
  163.  *
  164.  * The end-developper need to call the factory() method to make an instance :
  165.  *      $x =& XML_FastCreate::factory('Text');
  166.  * Simple example to make a valid XHTML page :
  167.  * <code>
  168.  * <?php
  169.  *  require_once 'XML/FastCreate.php';
  170.  *  $x =& XML_FastCreate::factory('Text');
  171.  *  $x->html(
  172.  *     $x->head(
  173.  *          $x->title("A simple XHTML page")
  174.  *     ),
  175.  *     $x->body(
  176.  *         $x->div(
  177.  *             $x->h1('Example'),
  178.  *             $x->br(),
  179.  *             $x->a(array('href' => 'http://pear.php.net'), 'PEAR WebSite')
  180.  *         )
  181.  *     )
  182.  *  );
  183.  *  // Write output
  184.  *  $x->toXML();
  185.  * ?>
  186.  * </code>
  187.  * KNOWN BUGS :
  188.  * - XML_DTD is an alpha version
  189.  *      - Some DTD couln't correctly interpreted (like XHTML 1.1)
  190.  *      - You can use an external program like XMLLINT for check validation
  191.  *
  192.  * PHP versions 4 and 5
  193.  *
  194.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  195.  * that is available through the world-wide-web at the following URI:
  196.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  197.  * the PHP License and are unable to obtain it through the web, please
  198.  * send a note to license@php.net so we can mail you a copy immediately.
  199.  *
  200.  * @category   XML
  201.  * @package    XML_FastCreate
  202.  * @author     Guillaume Lecanu <Guillaume@dev.fr>
  203.  * @copyright  1997-2005 The PHP Group
  204.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  205.  * @version    CVS: $Id: FastCreate.php,v 1.7 2005/12/10 17:26:54 guillaume Exp $
  206.  * @link       http://pear.php.net/package/XML_FastCreate
  207.  * @see        XML_Tree
  208.  */
  209. class XML_FastCreate extends XML_FastCreate_Overload 
  210. {
  211.     // {{{ properties
  212.     
  213.     /**
  214.     * DTD Filename for check validity of XML
  215.     *
  216.     * @var      string
  217.     * @access   private
  218.     */
  219.     var $_dtd;
  220.     
  221.     /**
  222.     * Enable / disable output indentation
  223.     *
  224.     * @var      boolean
  225.     * @access   private
  226.     */
  227.     var $_indent = false;
  228.  
  229.     /**
  230.     * Write output to a file
  231.     *
  232.     * @var      string
  233.     * @access   private
  234.     */
  235.     var $_file;
  236.     
  237.     /**
  238.     * Run external command after write output into file
  239.     *
  240.     * @var      string
  241.     * @access   private
  242.     */
  243.     var $_exec;
  244.     
  245.     /*
  246.     * Flag to know if the factory is used
  247.     *
  248.     * @var      boolean
  249.     * @access   private
  250.     */
  251.     var $_factory = false;
  252.     
  253.     /*
  254.     * Name of the driver use
  255.     *
  256.     * @var      string
  257.     * @access   private
  258.     */
  259.     var $_driver;
  260.     
  261.     /*
  262.     * List of tags replacements
  263.     *
  264.     * @var      array
  265.     * @access   private
  266.     */
  267.     var $_translate;
  268.     
  269.     /*
  270.     * List of entities to convert
  271.     *
  272.     * @var      array
  273.     * @access   private
  274.     */
  275.     var $_entities = array('&', '<', '>', '"', "'");
  276.     
  277.     /*
  278.     * List of replacement of entities
  279.     *
  280.     * @var      array
  281.     * @access   private
  282.     */
  283.     var $_replaces = array('&', '<', '>', '"', ''');
  284.         
  285.     // }}}
  286.     // {{{ factory()
  287.     
  288.     /**
  289.      * Factory : Make an instance of XML_FastCreate object
  290.      *
  291.      * @param string $driver    Driver to use ("Text", "XML_Tree"..)
  292.      *
  293.      * @param array $options    Hashtable of options :
  294.      *
  295.      *      'dtd' :         Set the DTD file to check validity
  296.      *                      [required the XML_DTD package]
  297.      *
  298.      *      'indent' :      Enable / disable output indentation
  299.      *
  300.      *      'version' :     Set the XML version (default = '1.0')
  301.      *
  302.      *      'encoding' :    Set the encoding charset (default = 'UTF-8')
  303.      *
  304.      *      'standalone' :  Set the standalone attribute (default = 'no')
  305.      *
  306.      *      'doctype'   :   DocType string, set manually or use :
  307.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_1
  308.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_STRICT
  309.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_FRAMESET
  310.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_TRANSITIONAL
  311.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_STRICT
  312.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_FRAMESET
  313.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_TRANSITIONAL
  314.      *
  315.      *      'quote' :       Auto quote attributes & contents (default = true)
  316.      *
  317.      *      'translate' :   Hashtable of tags to translate to anothers :
  318.      *                      'translate' => array(
  319.      *                          'title' => array('<h1 class="title"><span>', 
  320.      *                                          '</span></h1>'),
  321.      *                          'date'  => array('<span class="date">', 
  322.      *                                          '</span>'),
  323.      *                      )
  324.      *      
  325.      *      'exec' :        Use an external tool to valid the document
  326.      *
  327.      *      'file' :        Write the validation output to a file
  328.      *
  329.      *      'expand' :      Return single tag with the syntax : 
  330.      *                      <tag></tag> rather <tag /> (default = false)
  331.      *                      ( set to true if you write HTML )
  332.      *          
  333.      *      'apos' :        Quote apostrophe to ' (default = true) 
  334.      *                      <! WARNING !>
  335.      *                      For valid XML, you must let this option to true.
  336.      *                      If you write XHTML, Microsoft Internet Explorer 
  337.      *                      won't recognize this entitie, so you need to turn
  338.      *                      this option to false.
  339.      *
  340.      *      'singleAttribute' : Accept single attributes (default = false)
  341.      *                      ex: $x->input(array('type'=>'checkbox', 
  342.      *                              checked=>true))
  343.      *                      =>  <input type="checkbox" checked />
  344.      *                      <! WARNING !> 
  345.      *                      This syntax is not valid XML.
  346.      *                      For valid XML, don't use this option, use this :
  347.      *                      ex: $x->input(array('type'=>'checkbox', 
  348.      *                              checked=>'checked'))
  349.      *                      =>  <input type="checkbox" checked=>"checked" />
  350.      * 
  351.      * @return object       An XML_FastCreate_<driver> instance
  352.      * @access public
  353.      * @static
  354.      */
  355.     function &factory($driver, $options = array())
  356.     {
  357.         @include_once "FastCreate/{$driver}.php";
  358.         $class = 'XML_FastCreate_'.$driver;
  359.         if (!class_exists($class)) {
  360.             return PEAR::raiseError("Unable to include the XML/FastCreate/"
  361.                 .$driver.".php file.", XML_FASTCREATE_ERROR_NO_DRIVER, 
  362.                 PEAR_ERROR_DIE);
  363.         }
  364.         $obj = new $class($options);
  365.         return $obj;
  366.     }
  367.     // }}}
  368.     // {{{ XML_FastCreate()
  369.     
  370.     /**
  371.      * Constructor method. Use the factory() method to make an instance 
  372.      * 
  373.      * @param array $options    Hashtable of options. See factory() for details.
  374.      *
  375.      * @return object           An XML_FastCreate instance
  376.      * @access private
  377.      */
  378.     function XML_FastCreate($options = array())
  379.     {
  380.         if ($this->_factory) {
  381.         
  382.             $this->PEAR();
  383.             $this->_dtd = (isSet($options['dtd']) 
  384.                         ? $options['dtd'] : '');
  385.             $this->_file = (isSet($options['file']) 
  386.                         ? $options['file'] : '');
  387.             $this->_exec = (isSet($options['exec']) 
  388.                         ? $options['exec'] : '');
  389.             if (isSet($options['indent'])) {
  390.                 $this->_indent = $options['indent'];
  391.             }
  392.             if (isSet($options['translate'])) {
  393.                 $this->_translate = $options['translate'];
  394.             }
  395.             if ($this->_dtd) {
  396.                 include_once 'XML/DTD/XmlValidator.php';
  397.             }
  398.             if (!isSet($options['apos'])) {
  399.                 $options['apos'] = true;
  400.             }
  401.             if (!$options['apos']) {
  402.                 array_pop($this->_entities);
  403.                 array_pop($this->_replaces);
  404.             }
  405.  
  406.         } else {
  407.             PEAR::raiseError("Use the factory() method please.",
  408.                 XML_FASTCREATE_ERROR_NO_FACTORY, 
  409.                 PEAR_ERROR_DIE);
  410.         }
  411.     }
  412.     // }}}
  413.     // {{{ _call()
  414.     
  415.     /**
  416.      * Overloading management
  417.      * 
  418.      * @param string $method    Name of the function overloaded
  419.      * @param array $args       List of arguments of the function overloaded
  420.      * 
  421.      * @return mixed 
  422.      * @access private
  423.      */
  424.     function _call(&$method, &$args) 
  425.     {
  426.         array_unshift($args, $method);
  427.         return call_user_func_array(array(&$this, 'xml'), $args);
  428.     }
  429.     // }}}
  430.     // {{{ toXML()
  431.     
  432.     /**
  433.      * Print the current XML to standard output
  434.      *
  435.      * @return mixed    Return true or a PEAR Error object
  436.      * @access public
  437.      */
  438.     function toXML()
  439.     {
  440.         $xml = $this->getXML();
  441.         if ($this->_indent) {
  442.             $xml = $this->indentXML($xml);
  443.         }
  444.         print $xml;
  445.  
  446.         // Check Validity
  447.         if ($this->_dtd) {
  448.             return $this->isValid($xml);
  449.         }
  450.  
  451.         // Write output to file
  452.         if ($this->_file) {
  453.             $fp = fopen($this->_file, 'w+');
  454.             fwrite($fp, $xml);
  455.             fclose($fp);
  456.         }
  457.         
  458.         // Run an external program
  459.         if ($this->_exec) {
  460.            $return = shell_exec($this->_exec);
  461.            if ($return) {
  462.                 return PEAR::raiseError($return, XML_FASTCREATE_ERROR_DTD);
  463.            }
  464.         }
  465.  
  466.         return true;
  467.     }
  468.     // }}}
  469.     // {{{ isValid()
  470.  
  471.     /**
  472.      * Check if the XML respect the DTD.
  473.      * Require the XML_DTD package
  474.      *
  475.      * @param string $xml   The XML text to check
  476.      *
  477.      * @return boolean      Return true if valid
  478.      * @access public
  479.      */
  480.     function isValid(&$xml)
  481.     {
  482.         $validator = new XML_DTD_XmlValidator;
  483.         $tree = new XML_Tree();
  484.         $nodes = $tree->getTreeFromString($xml);
  485.         if (PEAR::isError($nodes)) {
  486.             return $nodes;
  487.         }
  488.         $parser =& new XML_DTD_Parser;
  489.         $validator->dtd = $parser->parse($this->_dtd);
  490.         $validator->_runTree($nodes);
  491.         if ($validator->_errors) {
  492.             $errors = $validator->getMessage();
  493.             return PEAR::raiseError($errors, XML_FASTCREATE_ERROR_DTD);
  494.         }
  495.         return true;
  496.     }
  497.     // }}}
  498.     // {{{ _quoteEntities()
  499.  
  500.     /**
  501.      * Replace XML special characters by their entities
  502.      *
  503.      * Convert :  &      <     >     "       '
  504.      *      To :  &  <  >  "  '
  505.      * 
  506.      * @param string $content   Content to be quoted
  507.      *
  508.      * @return string           The quoted content
  509.      * @access private
  510.      */
  511.     function _quoteEntities($content)
  512.     {
  513.         return str_replace($this->_entities, $this->_replaces, $content);
  514.     }
  515.     // }}}
  516.     // {{{ indentXML()
  517.  
  518.     /**
  519.      * Indent an XML text 
  520.      *
  521.      * @param string $xml   XML text to indent
  522.      * 
  523.      * @return string       The XML text indented
  524.      * @acess public
  525.      */
  526.     function indentXML($xml)
  527.     {
  528.         require_once "XML/Beautifier.php";
  529.         $fmt = new XML_Beautifier();
  530.         $out =& $fmt->formatString($xml);
  531.         return $out;
  532.     }
  533.     // }}}
  534.     // {{{ xml()
  535.     
  536.     /** 
  537.      *  Make an XML tag.
  538.      *
  539.      *  Accept all forms of parameters.
  540.      *
  541.      * @param string $tag       Name of the tag
  542.      * @param array $args       Optional list for attributes
  543.      * @param array $contents   Optional list of contents (strings or sub tags)
  544.      *
  545.      * @return mixed            See the driver specification
  546.      * @access public
  547.      */
  548.     function xml($tag) 
  549.     {
  550.         $attribs = array();
  551.         $args = func_get_args();
  552.         array_shift($args);
  553.         if ((count($args) > 0) && is_array($args[0])) {
  554.             $attribs = $args[0];
  555.             array_shift($args);
  556.         }
  557.         if ($tag{0} == '_') {
  558.             $tag = substr($tag, 1);
  559.         } else {
  560.         
  561.             if (isSet($this->_translate[$tag])) {
  562.                 if (isSet($this->_translate[$tag][1])) {
  563.                     $open  =& $this->_translate[$tag][0];
  564.                     $close =& $this->_translate[$tag][1];
  565.                 } elseif (isSet($this->_translate[$tag][0])) {
  566.                     $open  = '<'.$this->_translate[$tag][0].'>';
  567.                     $close = '</'.$this->_translate[$tag][0].'>';
  568.                 } else {
  569.                     $open  = '<div class="'.$tag.'">';
  570.                     $close = '</div>';
  571.                 }
  572.                 return $this->importXML($open.$this->exportXML($args).$close);
  573.             } 
  574.         }
  575.         return $this->makeXML($tag, $attribs, $args);
  576.     }
  577.     // }}}
  578.  
  579.  
  580.     // -------------------------------------------------------- \\
  581.     // --- Abstract methods to be implemented by the driver --- \\
  582.     // -------------------------------------------------------- \\
  583.  
  584.     // {{{ makeXML()
  585.     
  586.     /**
  587.      * Make an XML Tag 
  588.      *
  589.      * @param string $tag       Name of the tag
  590.      * @param array $attribs    List of attributes
  591.      * @param array $contents   List of contents (strings or sub tags)
  592.      * 
  593.      * @return mixed            See the driver specifications
  594.      * @access public
  595.      */
  596.     function makeXML($tag, $attribs = array(), $contents = array()) 
  597.     {
  598.     }
  599.     // }}}
  600.     // {{{ quote()
  601.     
  602.     /**
  603.      * Encode a string to be include in XML tags.
  604.      *
  605.      * To use only if the 'quoteContents' is false
  606.      * Convert :  &      <     >     "       '
  607.      *      To :  &  <  >  "  '
  608.      * 
  609.      * @param string $content   Content to be quoted
  610.      *
  611.      * @return string           The quoted content
  612.      * @access public
  613.      */
  614.     function quote($content) 
  615.     {
  616.     }
  617.     // }}}
  618.     // {{{ noquote()
  619.  
  620.     /**
  621.      * Don't quote this content.
  622.      *
  623.      * To use only if the 'quoteContents' is true
  624.      * 
  625.      * @param string $content   Content to escape quoting
  626.      *
  627.      * @return string           The content not quoted
  628.      * @access public
  629.      */
  630.     function noquote($content) 
  631.     {
  632.     }
  633.     // }}}
  634.     // {{{ comment()
  635.  
  636.     /**
  637.      * Make an XML comment
  638.      *
  639.      * @param mixed $content    Content to comment
  640.      * 
  641.      * @return mixed            See the driver specifications
  642.      * @access public
  643.      */
  644.     function comment($content) 
  645.     {
  646.     }
  647.     // }}}
  648.     // {{{ cdata()
  649.  
  650.     /**
  651.      * Make a CDATA section <![CDATA[ (...) ]]>
  652.      *
  653.      * @param mixed $content    Content of the section
  654.      * 
  655.      * @return mixed            See the driver specifications
  656.      * @access public
  657.      */
  658.     function cdata($content) 
  659.     {
  660.     }
  661.     // }}}
  662.     // {{{ getXML()
  663.  
  664.     /**
  665.      * Return the current XML text 
  666.      *
  667.      * @return string           The current XML text
  668.      * @access public
  669.      */
  670.     function getXML() 
  671.     {
  672.     }
  673.     // }}}
  674.     // {{{ importXML()
  675.  
  676.     /**
  677.      * Import XML text to driver data
  678.      *
  679.      * @param mixed $xml        The XML text
  680.      * 
  681.      * @return mixed            See the driver specifications
  682.      * @access public
  683.      */
  684.     function importXML($xml) 
  685.     {
  686.     }
  687.     // }}}
  688.     // {{{ exportXML()
  689.  
  690.     /**
  691.      * Export driver data to XML text
  692.      *
  693.      * @param mixed $xml        The XML data driver 
  694.      * 
  695.      * @return string           The XML text
  696.      * @access public
  697.      */
  698.     function exportXML($xml) 
  699.     {
  700.     }
  701.     // }}}
  702.  
  703. }
  704. // }}}
  705.  
  706. ?>
  707.